<?php
  INCLUDE "F_CONX.php";
  $V_REPORTE = $HTTP_POST_VARS["V_REPORTE"];
  $V_AREA    = $HTTP_POST_VARS["V_ZONA2"];
  $MS_SQLN="SELECT * FROM notas WHERE reporte='$V_REPORTE' AND area='$V_AREA'";
  $RES_NOT=MYSQL_QUERY($MS_SQLN);
  $NUM_NOT=MYSQL_NUM_ROWS($RES_NOT);
  IF ($NUM_NOT>0)
    $MS_SQLN="UPDATE notas SET nota = '$V_NOTAS' WHERE reporte='$V_REPORTE' AND area = '$V_AREA' ";
  ELSE
    $MS_SQLN="INSERT INTO notas VALUES ('$V_REPORTE','$V_AREA','$V_NOTAS')";
  $result=MYSQL_QUERY($MS_SQLN);
  if (!$result)    die('Invalid query: ' . mysql_error());
  HEADER("LOCATION: P_BODY.php");
?>
